import { defineConfig } from 'vite';
import uni from '@dcloudio/vite-plugin-uni';
// https://vitejs.dev/config/
export default defineConfig({
  server: {
    host: '0.0.0.0',
    port: 80,
    open: true,
    proxy: {
      ['/dev-api']: {
        // target: `http://grngbr.natappfree.cc`,
        // target: `http://192.168.2.84:24836`, // gs
        target: `http://192.168.2.64:24836`, // gs
        // target: `http://127.0.0.1:20080`, // 打包
        changeOrigin: true,
        ws: true,
        rewrite: (path) => path.replace(new RegExp('^' + '/dev-api'), ''),
      },
    },
  },
  plugins: [uni()],
  css: {
    preprocessorOptions: {
      scss: {
        // sass即将弃用的js-api和颜色函数警告屏蔽
        silenceDeprecations: ['legacy-js-api', 'color-functions'],
      },
    },
  },
});
